#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import yaml

class ConfigReaderError(Exception):
    def __init__(self, message):
        Exception.__init__(self, message)

class ConfigReader:
    def read(self, filepath):      
        
        fd = None
        try:
            fd = file(filepath, "r")
            return yaml.load(fd)
        except Exception:
            raise ConfigReaderError(str("Unable to read configuration file: %s" % filepath))
        finally:
            if fd: fd.close() 
            
